﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Data;
using System.Reflection;
using System.Runtime.Serialization;
using System.Data.Objects;

namespace GTServices.Entities
{
    /// <summary>
    /// Stubbing for when we eventually have a server side solution aswell. 
    /// </summary>
    public class User : BaseEntity
    {
        [Key]
        public Guid Id { get; set; }
        public String FirstName { get; set; }
        public String LastName { get; set; }
        public String LiveId { get; set; }
        public Guid Puid { get; set; }

        public override void Validate()
        {
            if (String.IsNullOrEmpty(FirstName))
            {
                throw new ArgumentException("Null or Empty FirstName");
            }
            if (String.IsNullOrEmpty(LastName))
            {
                throw new ArgumentException("Null or Empty LastName");
            }
            if (String.IsNullOrEmpty(LiveId))
            {
                throw new ArgumentException("Null or Empty LiveId");
            }


            if (Puid == null)
            {
                throw new ArgumentException("Puid is Null");
            }
        }


        public override bool Equals(object obj)
        {
            if (!(obj is Template))
            {
                return false;
            }
            return (obj as Template).Id == this.Id;
        }
    }
}
